#pragma once

#include "ScriptCompiler/AST/ExpressionNode.h"

class CScriptToken;
class CTypeNode;

class CFunctionCallNode : public CExpressionNode
{
public:
    CFunctionCallNode(std::weak_ptr<CScriptFileContext> InFile)
        : CExpressionNode(InFile, EASTNodeType::FunctionCall)
    {
    }

    //function name
    std::shared_ptr<CScriptToken> Name;

    //left '<'
    TOptional<std::shared_ptr<CScriptToken>> LeftAngleBracket;

    TVector<std::shared_ptr<CTypeNode>> GenericArguments;

    //right angle bracket '>'
    TOptional<std::shared_ptr<CScriptToken>> RightAngleBracket;

    //function arguments
    TVector<std::shared_ptr<CExpressionNode>> Arguments;

    bool bAfterNew = false;

    CString GetFunctionName() ;

    virtual void DebugPrint(int32_t InDepth) override;

    virtual std::shared_ptr<CScriptToken> GetFirstToken() override { return Name; }
};